<template>
  <h1>El-单选组件</h1>
  <el-radio-group v-model="edu">
    <el-radio label="学历:高中" value="高中"></el-radio>
    <el-radio label="学历:大专" value="大专"></el-radio>
    <el-radio label="学历:本科" value="本科"></el-radio>
    <el-radio label="学历:硕士" value="硕士"></el-radio>
  </el-radio-group>
  <h4>您选择的学历是:{{edu}}</h4>

  <hr>
  <el-radio-group v-model="pri">
    <el-radio-button v-for="item in arr" :label="item.title" :value="item.price"></el-radio-button>
  </el-radio-group>
  <h4>您选择的酒价是:{{pri}}</h4>
</template>

<script setup>
import {ref} from "vue";
//定义变量用于双向绑定收集用户选择的学历数据
const edu = ref('本科');

//定义数组用来模拟从后端请求回来的商品数据
const arr = ref([
  {title:'五粮液',price:'1818'},
  {title:'茅台',price:'8641'},
  {title:'山庄老酒',price:'1564'},
  {title:'汾酒',price:'4899'}
]);
//定义变量用来保存收集到的数据
const pri = ref('');
</script>


<style scoped>

</style>